<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateOrderReview extends Migrator
{
    public function up(){
        $table = $this->table('order_review',['signed' => false,'comment'=>'订单评论表']);
//        $table->addColumn('order_id','integer',['limit'=>10,'comment'=>'订单id'])
//              ->addForeignKey('order_id', 'order', 'id', ['delete'=> 'CASCADE'])
//              ->addColumn('user_id','integer',['limit'=>10,'comment'=>'评价发起人'])
//              ->addColumn('price','decimal',['precision'=>10,'scale'=>2,'comment'=>'订单金额'])
//              ->addColumn('rating','integer',['limit'=>1,'comment'=>'评分'])
//              ->addColumn('review','text',['comment'=>'评价内容'])
//              ->addColumn('img_url', 'text', ['comment' => 'json格式图片地址'])
//              ->addColumn('create_time','integer',['limit'=>10,'default'=>0,'comment'=>'评价时间'])
//             ->create();
    }

    public function down(){
        $this->dropTable('order_review');
    }
}
